package com.home.cop.sysinfo.mapper;


import com.home.cop.sysinfo.model.InstituteRelation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface InstituteRelationMapper {
    /**
     * 获取机构关系列表
     * @param instId
     * @return
     */
    public List<InstituteRelation> list(@Param("instId") Integer instId);

    /**
     * 删除机构关系
     * @param inst1Id
     * @param inst2Id
     */
    public void delete(@Param("inst1Id")Integer inst1Id,@Param("inst2Id")Integer inst2Id);

    /**
     * 删除所有相关联的关系
     * @param instId
     */
    public void deleteRelation(@Param("instId")Integer instId);

    /**
     * 新增机构关系
     * @param inst1Id
     * @param inst2Id
     * @param relationship
     */
    public void insert(@Param("inst1Id")Integer inst1Id,@Param("inst2Id")Integer inst2Id,@Param("relationship")String relationship);

    /**
     * 查询两个机构的关系
     * @param inst1Id
     * @param inst2Id
     * @return
     */
    public InstituteRelation selectRelationship(@Param("inst1Id")Integer inst1Id,@Param("inst2Id")Integer inst2Id);

    /**
     * 更新机构关系
     * @param instituteRelation
     * @return
     */
    public InstituteRelation modifyRelationship(InstituteRelation instituteRelation);
}